package domein.server;
import java.io.IOException;
import java.net.ServerSocket;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class MultiServer {
   
        public MultiServer(String ip)
        {
        	
            MyBuilder builder = new MyBuilder();
       
            System.setProperty("java.rmi.server.hostname", ip);
                String name = "Builder";
                IBuilder stub;
				try {
					stub = (IBuilder) UnicastRemoteObject.exportObject(builder, 0);
					 Registry registry = LocateRegistry.createRegistry(1099);
		               
		                registry.bind(name, stub);
		                
		               
		                System.out.println("builder bound");
				} catch (RemoteException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (AlreadyBoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
                
               
                
                
                

        
            
            
            
           
     

       
    }
}